//
//  Update3PLVC.m
//  LogisticsSupplier
//
//  Created by 吕晶 on 2021/5/8.
//  Copyright © 2021 吕晶. All rights reserved.
//

#import "Update3PLVC.h"

@interface Update3PLVC ()

@property (nonatomic, strong) UIButton *backBtn;
@property (nonatomic, strong) UIButton *commitBtn;

@end

@implementation Update3PLVC

-(UIButton *)backBtn {
    if (!_backBtn) {
        _backBtn = [[UIButton alloc] initWithFrame:CGRectMake(15, StatusBarHeight + 12, 24, 24)];
        [_backBtn setImage:[UIImage imageNamed:@"icon_return"] forState:0];
        [_backBtn addTarget:self action:@selector(backClick) forControlEvents:UIControlEventTouchUpInside];
    }
    return _backBtn;
}

-(UIButton *)commitBtn {
    if (!_commitBtn) {
        _commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(50, ScreenH * 0.5, ScreenW - 100, 48)];
        [_commitBtn setBackgroundColor:HexColor(0x2B2C44)];
        _commitBtn.layer.masksToBounds = YES;
        _commitBtn.layer.cornerRadius = 6;
        [_commitBtn setTitle:@"提交" forState:0];
        [_commitBtn setTitleColor:HexColor(0xffffff) forState:0];
        _commitBtn.titleLabel.font = BoldFontOfSize(16);
        [_commitBtn addTarget:self action:@selector(commitClick) forControlEvents:UIControlEventTouchUpInside];
    }
    return _commitBtn;
}

- (void)backClick {
    [self.rt_navigationController popViewControllerAnimated:YES];
}

- (void)commitClick {
    __weak_self;
    [MBProgressHUD leShowSuccessHUDAddedTo:self.view message:@"提交成功" delayOperation:^{
        [weakself.rt_navigationController popViewControllerAnimated:YES];
    }];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBar.hidden = YES;
    UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, ScreenW, ScreenH)];
    imgView.image = [UIImage imageNamed:@"update3pl"];
    [self.view addSubview:imgView];
    [self.view addSubview:self.backBtn];
    [self.view addSubview:self.commitBtn];
}



@end
